﻿<UserControl x:Class="CodeCounsel.SharePoint.RibbonDesigner.View.Tab"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:v="clr-namespace:CodeCounsel.SharePoint.RibbonDesigner.View"
             xmlns:a="clr-namespace:CodeCounsel.SharePoint.RibbonDesigner.View.AttachedBehaviors"
             xmlns:t="clr-namespace:CodeCounsel.SharePoint.RibbonDesigner.View.TypeConverters"
             d:DesignHeight="100"
             d:DesignWidth="500"
             mc:Ignorable="d">
    <UserControl.Resources>
        <t:BooleanToVisibilityConverter x:Key="booleanVisibilityConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <ScrollViewer Grid.Row="0" Grid.Column="0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden">
            <ItemsControl ItemsSource="{Binding Groups}" AlternationCount="2" 
                          a:DragDropHelper.IsDropTarget="True"
                          a:DragDropHelper.IsDragSource="True"
                          a:DragDropHelper.DropProcessor="{Binding}" 
                          a:DragDropHelper.DragProcessor="{Binding}" 
                          Focusable="False"
                          FocusManager.IsFocusScope="True">
                <ItemsControl.Background>
                    <LinearGradientBrush StartPoint="0, 0" EndPoint="0,1">
                        <LinearGradientBrush.GradientStops>
                            <GradientStop Color="White" Offset="0" />
                            <GradientStop Color="#edf0f2" Offset="1" />
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </ItemsControl.Background>
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
            </ItemsControl>
        </ScrollViewer>
        <v:ScalePicker DataContext="{Binding ScalePicker}" 
                       Visibility="{Binding ShowScalePicker, Converter={StaticResource booleanVisibilityConverter}}"
                       Grid.Row="0" Grid.Column="1" />
    </Grid>
</UserControl>